﻿using JXC.Core.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static JXC.Core.Models.UserInfos;

namespace JXC.EFCore
{
    public static class ModelBuilderExtensions
    {
        public static void Seed(this ModelBuilder modelBuilder)
        {

            modelBuilder.Entity<UserInfos>().HasData(
                new UserInfos
                {
                    Id = Guid.NewGuid(),
                    UserName = "admin",
                    UserPwd = "123456",
                    Creator = "1",
                    CreateTime = DateTime.Now,
                    UserState = 1,
                    IsDeleted = 1
                },
                new UserInfos
                {
                    Id = Guid.NewGuid(),
                    UserName = "小小",
                    UserPwd = "123456",
                    Creator = "1",
                    CreateTime = DateTime.Now,
                    UserState = 1,
                    IsDeleted = 1
                },
                new UserInfos
                {
                    Id = Guid.NewGuid(),
                    UserName = "大大",
                    UserPwd = "123456",
                    Creator = "1",
                    CreateTime = DateTime.Now,
                    UserState = 1,
                    IsDeleted = 1
                },
                new UserInfos
                {
                    Id = Guid.NewGuid(),
                    UserName = "张智毅销售员",
                    UserPwd = "123456",
                    Creator = "1",
                    CreateTime = DateTime.Now,
                    UserState = 1,
                    IsDeleted = 1
                }
                ,
                new UserInfos
                {
                    Id = Guid.NewGuid(),
                    UserName = "采购员",
                    UserPwd = "123456",
                    Creator = "1",
                    CreateTime = DateTime.Now,
                    UserState = 1,
                    IsDeleted = 1
                }

            );
            modelBuilder.Entity<Cinfo>().HasData(
                new Cinfo
                {
                    Id = Guid.NewGuid(),
                    WarehouseName = "饮料仓库",
                    MoneyKind = "人民币",
                    InventoryValue = 10000
                },
                 new Cinfo
                 {
                     Id = Guid.NewGuid(),
                     WarehouseName = "水果仓库",
                     MoneyKind = "人民币",
                     InventoryValue = 10000
                 },
                 new Cinfo
                 {
                     Id = Guid.NewGuid(),
                     WarehouseName = "调料仓库",
                     MoneyKind = "人民币",
                     InventoryValue = 10000
                 },
                  new Cinfo
                  {
                      Id = Guid.NewGuid(),
                      WarehouseName = "书籍仓库",
                      MoneyKind = "人民币",
                      InventoryValue = 10000
                  }
                );
            modelBuilder.Entity<GoodsType>().HasData(
                new GoodsType
                {
                    Id = Guid.NewGuid(),
                    TypeName = "饮料"
                },
                 new GoodsType
                 {
                     Id = Guid.NewGuid(),
                     TypeName = "水果"
                 },
                  new GoodsType
                  {
                      Id = Guid.NewGuid(),
                      TypeName = "调料"
                  },
                  new GoodsType
                  {
                      Id = Guid.NewGuid(),
                      TypeName = "书籍"
                  }
                );
            modelBuilder.Entity<Supplier>().HasData(
                new Supplier { 
                Id= Guid.NewGuid(),
                SupplierName="俊华供应商",
                Contactman="辛俊华",
                Position="经理",
                Address="河南省安阳市金城大道",
                City="河南省安阳市",
                Postcode="419007",
                Coutry="中国",
                Tel="17371813074",
                DepositBank="建设银行",
                BankAccount= "62122 62502 00918 2455",
                TaxNum="4029 1931 9398 4717",
                Website="www.WeiKe",
                Email="XinJunHua@163.com",
                Remarks="空",
                UseState=1
                },
                 new Supplier
                 {
                     Id = Guid.NewGuid(),
                     SupplierName = "俊乾供应商",
                     Contactman = "辛俊华",
                     Position = "经理",
                     Address = "河南省安阳市金城大道",
                     City = "河南省安阳市",
                     Postcode = "419007",
                     Coutry = "中国",
                     Tel = "17371813074",
                     DepositBank = "建设银行",
                     BankAccount = "62122 62502 00918 2455",
                     TaxNum = "4029 1931 9398 4717",
                     Website = "www.WeiKe",
                     Email = "XinJunHua@163.com",
                     Remarks = "空",
                     UseState = 1
                 },
                  new Supplier
                  {
                      Id = Guid.NewGuid(),
                      SupplierName = "俊正供应商",
                      Contactman = "辛俊华",
                      Position = "经理",
                      Address = "河南省安阳市金城大道",
                      City = "河南省安阳市",
                      Postcode = "419007",
                      Coutry = "中国",
                      Tel = "17371813074",
                      DepositBank = "建设银行",
                      BankAccount = "62122 62502 00918 2455",
                      TaxNum = "4029 1931 9398 4717",
                      Website = "www.WeiKe",
                      Email = "XinJunHua@163.com",
                      Remarks = "空",
                      UseState = 1
                  },
                   new Supplier
                   {
                       Id = Guid.NewGuid(),
                       SupplierName = "罗俊供应商",
                       Contactman = "辛俊华",
                       Position = "经理",
                       Address = "河南省安阳市金城大道",
                       City = "河南省安阳市",
                       Postcode = "419007",
                       Coutry = "中国",
                       Tel = "17371813074",
                       DepositBank = "建设银行",
                       BankAccount = "62122 62502 00918 2455",
                       TaxNum = "4029 1931 9398 4717",
                       Website = "www.WeiKe",
                       Email = "XinJunHua@163.com",
                       Remarks = "空",
                       UseState = 1
                   }
                );

        }
    }
}
